package cn.com.clearcloud.user.controller;

import cn.com.clearcloud.user.service.UserService;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@AllArgsConstructor
public class UserController {

    private final UserService userService;

    @PostMapping(value = "/user/debit/{userId}/{money}/{id}")
    public Integer debit(@PathVariable("userId") String userId,
                         @PathVariable("money") Integer money,
                        @PathVariable("id") Integer id) {
        Integer debit = userService.debit(userId, money, id);
        return debit;
    }

}
